A Large-scale Study of the Use of Eval in JavaScript Applications

نویسندگان

  • Gregor Richards
  • Christian Hammer
  • Brian Burg
  • Jan Vitek
چکیده

Transforming text into executable code with a function such as JavaScript’s eval endows programmers with the ability to extend applications, at any time, and in almost any way they choose. But this expressive power comes at a price. Reasoning about the dynamic behavior of programs that use this features becomes difficult. Any ahead-of-time analysis, to remain sound, is forced to make pessimistic assumptions about the impact of dynamically created code. This pessimism affects the optimizations that can be applied to programs, significantly limits the kinds of errors that can be caught statically and the security guarantees that can be enforced. A better understanding of how eval is used could lead to increased performance and security. This paper reports on a large-scale study of the use of eval in JavaScript-based web applications. We have recorded the behavior 317 MB of strings given as arguments to 481,844 calls to the eval function. We provide statistics on the nature and content of strings used in eval expressions, as well as their provenance and data obtained by observing their dynamic behavior. eval is evil. Avoid it. eval has aliases. Don’t use them. —Douglas Crockford

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

The Eval That Men Do - A Large-Scale Study of the Use of Eval in JavaScript Applications

Transforming text into executable code with a function such as JavaScript’s eval endows programmers with the ability to extend applications, at any time, and in almost any way they choose. But, this expressive power comes at a price: reasoning about the dynamic behavior of programs that use this feature becomes challenging. Any ahead-of-time analysis, to remain sound, is forced to make pessimis...

متن کامل

Stability analysis and selection of optimuim support system of large scale underground space-Case study

The Azad pumped storage power plant including the pumping and transformer cavern and surge tanks has been located in the Sanandaj-Sirjan formation with the alternation of slate and phyllite and meta sandstone.Due to the sensitivity and special use of these spaces, stability analysis and ensuring the safety of carven is very important.Nowadays, using the surface storage tanks is very costly; The...

متن کامل

Experimental Study of Sable Crack Growth in Thin Aluminium Sheet

Recent failure information from research teams in NASA Langley and others has shown that CTOA based fracture models calibrated on large C(T) and M(T) specimens can be transferred successfully to cracked aircraft fuselage structures for the assessment of their residual strength. A major difficulty that could limit the more extensive use of this failure parameter is its experimental measurement e...

متن کامل

Evaluation of Close-Range Photogrammetric Technique for Deformation Monitoring of Large-Scale Structures: A review

Close-range photogrammetry has been used in many applications in recent decades in various fields such as industry, cultural heritage, medicine and civil engineering. As an important tool for displacement measurement and deformation monitoring, close-range photogrammetry has generally been employed in industrial plants, quality control and accidents. Although close-range photogrammetric applica...

متن کامل

Automatic fault localization for client-side JavaScript

JAVASCRIPT is a scripting language that plays a prominent role in web applications today. It is dynamic, loosely typed, asynchronous, and is extensively used to interact with the DOM at runtime. All these characteristics make JAVASCRIPT code error-prone; unfortunately, JAVASCRIPT fault localization remains a tedious and mainly manual task. Despite these challenges, the problem has received very...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2010